The Digital Time Machine
Git acts as a digital time machine by recording every state of your project through unique cryptographic identifiers called checksums. Every time you commit, Git creates a snapshot of your entire directory. By accessing this history, you can temporarily "teleport" your working directory back to a previous point in time to inspect how files like index.html, orange.html, or blue.html looked before recent changes.
1. Viewing Project History
The command git log displays the full chronological history. However, git log --oneline is often preferred as it compresses information into a summary where each commit is represented by a 7-character abbreviated checksum and its message.
54650a3 Create blue and orange pages
2. Terminal Navigation
When viewing a long history, standard terminal keys apply: press the space bar to scroll down page by page, and press the letter q to return to the command line prompt.
3. The Checkout Command
The command git checkout <commit-id> (e.g., git checkout 54650a3) allows you to View a previous commit. This updates the files in your folder to match that specific historical snapshot, effectively freezing the project in the past for your review.